<template>
  <div>
    {{ routes }}
    <el-menu>
      <el-menu-item v-for="(item, index) in routes" :key="index">
        <!-- <i :class="item[0].meta.icon" /> -->
        <svg-icon :icon-class="item[0].meta.icon" />
        <template #title>
          <span>{{ item[0].meta.title }}</span>
        </template>
      </el-menu-item>
    </el-menu>
  </div>
</template>
<script>
export default {
  computed: {
    routes() {
      const arr = this.$router.options.routes.filter((item) => !item.hidden)
      return arr.map((item) => {
        return item.children.filter((i) => !i.hidden)
      })
    }
  },
  created() {
    console.log(this.$router.options.routes)
  }
}
</script>
<style></style>
